home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / TURB_VIS / XDATE / DT_TEST.PAS next >
Pascal/Delphi Source File  |  1992-02-05  |  1KB  |  62 lines

  1. {*****************************************************************}
  2. { Author:        Michael L. Peters                                }
  3. { Date:          February 3, 1992                                 }
  4. { Purpose:       To demonstrate the XDate Unit.                   }
  5. { Copywrite (c): Avialable to the public domain                   }
  6. {                                                                 }
  7. {*****************************************************************}
  8. program DT_Test;
  9.  
  10. uses
  11.   Dos, Objects, Drivers, Views, App,
  12.   Gadgets,
  13.   XDate;
  14.  
  15. type
  16.  
  17.   { TTD_Test }
  18.  
  19.   PTD_Test = ^TTD_Test;
  20.   TTD_Test       = object(TApplication)
  21.     Date: PDateView;
  22.     clock: PClockView;
  23.     constructor Init;
  24.     procedure Idle; virtual;
  25.   end;
  26.  
  27. constructor TTD_Test.Init;
  28. var
  29.   R: TRect;
  30.   I: Integer;
  31. begin
  32.   TApplication.Init;
  33.  
  34. GetExtent(R);
  35.   R.A.X := R.B.X - 9;R.B.Y := R.A.Y + 1;
  36.   Clock := New(PclockView, Init(R));
  37.   Insert(clock);
  38.  
  39. GetExtent(R);
  40.   Dec(R.B.X);
  41.   R.A.X := R.B.X - 14;R.A.Y := R.B.Y - 1;
  42.   Date := New(PdateView, Init(R));
  43.   Insert(date);
  44. end;
  45.  
  46. procedure TTD_Test.Idle;
  47.  
  48. begin
  49.   TApplication.Idle;
  50.   date^.Update;
  51.   clock^.Update;
  52. end;
  53.  
  54. var
  55.   Demo: TTD_Test;
  56.  
  57. begin
  58.   Demo.Init;
  59.   Demo.Run;
  60.   Demo.Done;
  61. end.
  62.